/*
* Conditions Of Use
*
* This software was developed by employees of the Sigmatrix(Beijing) Corporation.
* This software is provided by sigmatrix as a service and is expressly
* provided "AS IS."  Sigmatrix MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
* AND DATA ACCURACY.  Sigmatrix does not warrant or make any representations
* regarding the use of the software or the results thereof, including but
* not limited to the correctness, accuracy, reliability or usefulness of
* the software.
*
* Permission to use this software is contingent upon your acceptance
* of the terms of this agreement.
*
*/
package com.sigmatrix.h5.enums;

import com.sigmatrix.h5.utils.Cons;

/**
 *@ClassName: ModuleCodeEnum
 *@Description: 各模块编码Enum,code码组成:类型+日期部分+其他部分+数值部分
 *@author youjun
 *@date 2017年7月17日 上午11:49:05
 */
public enum ModuleCodeEnum {
	
	/**车间*/
	WORKSHOP("WS", Cons.DATA_PART_TYPE_NO, 4, "车间", false),
	
	/**产线*/
	PRODUC_TLINE("PL", Cons.DATA_PART_TYPE_NO, 5, "产线", false),
	
	/**工控机*/
	IPC("IPC", Cons.DATA_PART_TYPE_NO, 5, "工控机", false),
	
	/**生产班组*/
	WORKTEAM("WT", Cons.DATA_PART_TYPE_NO, 4, "生产班组", false),
	
	/**原因代码*/
	REASON("RSN", Cons.DATA_PART_TYPE_NO, 4, "原因代码", false),
	
	/**仓库代码*/
	WAREHOUSE("WH", Cons.DATA_PART_TYPE_NO, 4, "仓库代码", false),
	
	/**手持机账号代码*/
	PDA_ACCOUNT("PDAA", Cons.DATA_PART_TYPE_NO, 4, "手持机账号代码", false),
	
	/**PDA代码*/
	PDA("PDA", Cons.DATA_PART_TYPE_NO, 4, "PDA代码", false),
	
	/**终端门店*/
	TERMINAL_SHOP("TS", Cons.DATA_PART_TYPE_NO, 5, "终端门店代码", false),
	
	/**订单编号*/
	PRODUCTION_ORDER("PO", Cons.DATA_PART_TYPE_YYYYMMMDD, 4, "订单编号代码", false),
	
	/**任务编号*/
	PRODUCTION_TASK("PT", Cons.DATA_PART_TYPE_YYYYMMMDD, 4, "任务编号代码", false),
	
	
	/**组箱*/
	STACK_BOX("SB", Cons.DATA_PART_TYPE_YYMMMDD, 3, "组箱", true),
	
	/**拆箱*/
	DEVANNING_BOX("DB", Cons.DATA_PART_TYPE_YYMMMDD, 3, "拆箱", true),
	
	/**组垛*/
	STACK_PILE("SP", Cons.DATA_PART_TYPE_YYMMMDD, 3, "组垛", true),
	
	/**拆垛*/
	DEVANNING_PILE("DP", Cons.DATA_PART_TYPE_YYMMMDD, 3, "拆垛", true),
	
	/**生产入库*/
	PRODUCE_STORAGE_IN("PSI", Cons.DATA_PART_TYPE_YYMMMDD, 3, "生产入库", true),
	
	/**销售退库*/
	SALES_STORAGE_IN("SSI", Cons.DATA_PART_TYPE_YYMMMDD, 3, "销售退库", true),
	
	/**收货入库*/
	RECEIVE_STORAGE_IN("RSI", Cons.DATA_PART_TYPE_YYMMMDD, 3, "收货入库", true),
	
	/**其他入库*/
	OTHER_STORAGE_IN("OSI", Cons.DATA_PART_TYPE_YYMMMDD, 3, "其他入库", true),
	
	/**销售出库*/
	SALES_STORAGE_OUT("SSO", Cons.DATA_PART_TYPE_YYMMMDD, 3, "销售出库", true),
	
	/**返工出库*/
	REWORK_STORAGE_OUT("RSO", Cons.DATA_PART_TYPE_YYMMMDD, 3, "返工出库", true),
	
	/**调拨出库*/
	ALLOT_STORAGE_OUT("ASO", Cons.DATA_PART_TYPE_YYMMMDD, 3, "调拨出库", true),
	
	/**其他出库*/
	OTHER_STORAGE_OUT("OSO", Cons.DATA_PART_TYPE_YYMMMDD, 3, "其他出库", true);
	
	/**模块编码*/
	private String moduleCode;
	
	/**code组成中的日期部分,0无,1:YYYYMMDD,2:YYMMDD*/
	private Integer dataPartType;

	/**其他部分*/
	private String otherPart;
	
	/**数值部分位数*/
	private Integer numericalDigits;
	
	/**模块描述*/
	private String desc;
	
	/**其他部分是否必须*/
	private Boolean isQequiredOtherPart;
	
	/**
	 *@Title: ModuleCodeEnum
	 *@Description: code码组成:类型+日期部分+其他部分+数值部分
	 *@param moduleCode 模块编码
	 *@param desc 描述
	 *@param numericalDigits 最后的数值部分位数
	 *@param dataPartType 日期部分,0无,1:YYYYMMDD,2:YYMMDD
	 *@param otherPart 其他部分
	 */
	private ModuleCodeEnum(String moduleCode, Integer dataPartType, Integer numericalDigits, String desc, Boolean isQequiredOtherPart) {
		this.moduleCode = moduleCode;
		this.desc = desc;
		this.numericalDigits = numericalDigits;
		this.dataPartType = dataPartType;
		this.isQequiredOtherPart = isQequiredOtherPart;
	}
	
	/**
	 *@Title: ModuleCodeEnum
	 *@Description: 用已有的Enum,和其他组成部分构造完整code,code码组成:类型+日期部分+其他部分+数值部分
	 *@param moduleCode 模块编码
	 *@param desc 描述
	 *@param numericalDigits 最后的数值部分位数
	 *@param dataPartType 日期部分,0无,1:YYYYMMDD,2:YYMMDD
	 *@param otherPart 其他部分
	 */
	private ModuleCodeEnum(final ModuleCodeEnum codeEnum, final String otherPart) {
		this.moduleCode = codeEnum.getModuleCode();
		this.desc = codeEnum.getDesc();
		this.numericalDigits = codeEnum.getNumericalDigits();
		this.dataPartType = codeEnum.getDataPartType();
		this.isQequiredOtherPart = codeEnum.getIsQequiredOtherPart();
		this.otherPart = otherPart;
	}

	/**
	 *@return the desc
	 */
	public String getDesc() {
		return desc;
	}

	/**
	 *@param desc the desc to set
	 */
	public void setDesc(String desc) {
		this.desc = desc;
	}

	/**
	 *@return the numericalDigits
	 */
	public Integer getNumericalDigits() {
		return numericalDigits;
	}

	/**
	 *@param numericalDigits the numericalDigits to set
	 */
	public void setNumericalDigits(Integer numericalDigits) {
		this.numericalDigits = numericalDigits;
	}

	/**
	 *@return the dataPartType
	 */
	public Integer getDataPartType() {
		return dataPartType;
	}

	/**
	 *@param dataPartType the dataPartType to set
	 */
	public void setDataPartType(Integer dataPartType) {
		this.dataPartType = dataPartType;
	}

	/**
	 *@return the otherPart
	 */
	public String getOtherPart() {
		return otherPart;
	}

	/**
	 *@param otherPart the otherPart to set
	 */
	public void setOtherPart(String otherPart) {
		this.otherPart = otherPart;
	}

	/**
	 *@return the moduleCode
	 */
	public String getModuleCode() {
		return moduleCode;
	}

	/**
	 *@param moduleCode the moduleCode to set
	 */
	public void setModuleCode(String moduleCode) {
		this.moduleCode = moduleCode;
	}

	/**
	 *@return the isQequiredOtherPart
	 */
	public Boolean getIsQequiredOtherPart() {
		return isQequiredOtherPart;
	}

	/**
	 *@param isQequiredOtherPart the isQequiredOtherPart to set
	 */
	public void setIsQequiredOtherPart(Boolean isQequiredOtherPart) {
		this.isQequiredOtherPart = isQequiredOtherPart;
	}
}
